<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .show {
            width: 100px;
            height: 200px;
            background-color: green;
        }
    </style>
</head>
<body>
    <div class="container">
        <script>
            let container = document.getElementById("container");
            // 重排  回流
            // container.style.width = '100px'
            // container.style.height = '200px'
            // 重绘
            // container.style.backgroundColor = 'green'
            container.classList.add('show')


            // let content = ''
            // 文档碎片 可以像真实DOM一样去挂载节点
            // let content = document.createDocumentFragment();

            for (var count = 0; count < 10000; count++) {
                //  执行会很快
                let oSpan = document.createElement('span');
                oSpan.innerHTML = '测试';
                content.appendChild(oSpan)                
            }
            // 慢 一次将文档碎片节点挂上去了， 交接    自动消失
            container.appendChild = content;

        </script>
    </div>
</body>
</html>